
#if !defined (_MPLANE_H)
#define _MPLANE_H

#include "mMath.h"

class mPlane
{

public:

	mPlane(void);
	mPlane(const mPlane &);
	mPlane(const mVector3 &, float);
	mPlane(const mVector3 &, const mVector3 &, const mVector3 &);
	virtual ~mPlane(void);

	mPlane & operator =(const mPlane &);
	bool operator ==(const mPlane &) const;
	bool operator !=(const mPlane &) const;
	mPlane operator -(void) const;

	//these functions need refining as they were only implemented quickly for bsp
	bool Intersect3(const mPlane & p2, const mPlane & p3, mVector3 & result);
	float GetDistance(const mVector3 & point) const;
	int ClassifyPoint(const mVector3 & point) const;
	mPlane lerp(const mPlane & p2, float factor);


protected:

	mVector3 Normal;
	float Intercept;

};

#define POINT_ON_PLANE 0;
#define POINT_IN_FRONT_OF_PLANE 1;
#define POINT_BEHIND_PLANE 2;

#endif 
